package Calendar类;

import java.util.Calendar;

public class demo01 {
    public static void main(String[] args) {
        Calendar c=Calendar.getInstance();
//        printDate(c);
//        setCalender(c);
        setCalender(c);
    }
    public static void setCalender(Calendar c){
        c.add(c.YEAR,5);
        c.add(c.MONTH,1);
        c.add(c.DATE,5);
        printDate(c);
    }
//    public static void setCalender(Calendar c){
//        c.set(c.YEAR,2000);
//        c.set(c.MONTH,11);
//        c.set(c.DATE,15);
//        printDate(c);
//    }
    public static void printDate(Calendar c){
        System.out.println("年:"+(c.get(c.YEAR)));
        System.out.println("月:"+(c.get(c.MONTH)));
        System.out.println("日:"+(c.get(c.DATE)));
        System.out.println("周:"+(c.get(c.WEEK_OF_MONTH)));
    }
}
